package com.ocom.nettyxf.service;

import com.sun.jna.Library;
import com.sun.jna.Native;

public interface JNASM2Dll extends Library {

	JNASM2Dll instanceDll = (JNASM2Dll) Native.load("SM2_Crypt", JNASM2Dll.class);

	//  JNASM2Dll instanceDll  = (JNASM2Dll)Native.load("native/SM2_Crypt.dll", JNASM2Dll.class);
	int add(int a, int b);

	//p_privateKey:32 byte
	//p_publicKey_X:32 byte
	//p_publicKey_Y: 32 byte
	public int sm2_make_key(byte[] p_privateKey,
							byte[] p_publicKey_X, byte[] p_publicKey_Y);

	//p_privateKey:32 byte
	//p_publicKey_X:32 byte
	//p_signature: 64 byte
	public int sm2_sign(char[] p_privateKey, char[] p_hash,
						char[] p_signature);

	//p_privateKey:32 byte
	//p_publicKey_X:32 byte
	//p_signature: 64 byte
	public int sm2_sign(byte[] p_privateKey, byte[] p_hash,
						byte[] p_signature);

	public int sm2_sign(String p_privateKey, String p_hash,
						String p_signature);

	//p_privateKey:32 byte
	//p_publicKey_X:32 byte
	//p_publicKey_Y:32 byte
	//p_hash:32 byte
	//p_signature: 64 byte
	public int sm2_verify(byte[] p_publicKey_X,
						  byte[] p_publicKey_Y, byte[] p_hash, byte[] p_signature);

	public int sm2_verify(String p_publicKey_X,
						  String p_publicKey_Y, String p_hash, String p_signature);
}
